<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>MeteoCal | Registration</title>
        <h:outputStylesheet name="css/style.css"/>
    </h:head>
    
    <h:body>
        <div id="screen">
            <h:form>
            <t style="font-size: 24px; font-weight: bold; color: white">Personal info</t>
                <h:panelGrid columns="3" id="regGrid" style="color: white; text-align: left; margin-top: 15px; margin-left: auto; margin-right: auto;">
                    <p:growl id="messages"  life="7000" showDetail="true" globalOnly="true" autoUpdate="true"/>
                    <h:outputLabel for="name">First name:</h:outputLabel>
                    <p:inputText id="name" value="#{signupBean.user.name}">
                        <p:ajax update="namemsg"/>
                    </p:inputText>
                    <p:message id="namemsg" for="name" />
                    
                    <h:outputLabel for="surname">Last name:</h:outputLabel>
                    <p:inputText id="surname" value="#{signupBean.user.surname}">
                        <p:ajax update="surnamemsg"/>
                    </p:inputText>
                    <p:message id="surnamemsg" for="surname" />
                    
                    <h:outputLabel for="city">City:</h:outputLabel>
                    <p:inputText id="city" value="#{signupBean.user.city}">
                        <p:ajax update="citymsg"/>
                    </p:inputText>
                    <p:message id="citymsg" for="city" />
                     
                    <h:outputLabel for="email">Email address:</h:outputLabel>
                    <p:inputText id="email" value="#{signupBean.user.email}" >
                        <p:ajax update="emailmsg"/>
                    </p:inputText>
                    <p:message id="emailmsg" for="email" />
                    
                    <h:outputLabel for="password">Password:</h:outputLabel>
                    <p:password id="password" value="#{signupBean.user.password}"
                                feedback="true" match="pwd2" label="Password"/>
                    <p:message for="password" />

                    <h:outputLabel for="pwd2">Confirm password:</h:outputLabel>
                    <p:password id="pwd2" label="Confirm password"/>
                </h:panelGrid>
                <br/><br/>
                <p:button id="cancel" value="CANCEL" outcome="login" style="alignment-adjust: central"/>
                &nbsp; &nbsp;
                <p:commandButton value="SIGN UP" update="regGrid" action="#{signupBean.register()}" style="alignment-adjust: central"/>
                <br/><br/>
            </h:form>
            
            <div id="footer">
            Software Engineering 2, academic year 2014-15 <br/>
            <m style="font-style:italic">Bartoli-Casarini-De Vos</m>
            </div>
            
        </div>
        
    </h:body>
</html>